<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
    xmlns:nav="http://kadm.org.ua/XMLSchema/Navigation"
    xmlns:article="http://kadm.org.ua/XMLSchema/Article"
    xmlns:page="http://kadm.org.ua/XMLSchema/Page"
    xmlns:date="http://kadm.org.ua/XMLSchema/Date"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/TR/xhtml1/strict"
    >

<xsl:output
    method="html"
    version="1.0"
    encoding="UTF-8"
    omit-xml-declaration="yes"
    standalone="yes"
    cdata-section-elements=""
    indent="yes"
    media-type="text/html"
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    />

    <xsl:param name="host" select="'http://local.com'" />
    <xsl:param name="root-path" select="concat($host, '/my')" />

    <xsl:template match="text()" />

    <xsl:template match="page:page/@title">
        <xsl:value-of select="." />
    </xsl:template>

    <xsl:template match="article:article">
        <xsl:apply-templates select="article:title" />
        <xsl:apply-templates select="article:content" />
    </xsl:template>

    <xsl:template match="article:title">
        <h3 class="header">
            <xsl:value-of select="." />
        </h3>
    </xsl:template>

    <xsl:template match="article:content">
        <div class="post-content">
            <xsl:copy-of select="*" />
        </div>
    </xsl:template>

    <xsl:template match="nav:submenu">
        <div class="left-menu">
            <h4 class="title"><xsl:value-of select="@name" /></h4>
            <xsl:apply-templates select="nav:link" />
        </div>
    </xsl:template>

    <xsl:template match="nav:submenu/nav:link">
        <div><a href="{@href}"><xsl:value-of select="." /></a></div>
    </xsl:template>

    <xsl:template match="nav:submenu/nav:link[@active]">
        <div class="selected">
            <div class="line">&#160;</div>
            <div class="text"><span><xsl:value-of select="." /></span></div>
        </div>
    </xsl:template>

    <xsl:template match="nav:main">
        <div class="main-menu">
            <xsl:apply-templates select="nav:link" />
        </div>
    </xsl:template>

    <xsl:template match="nav:main/nav:link">
        <div><a href="{@href}"><xsl:value-of select="." /></a></div>
    </xsl:template>

    <xsl:template match="nav:main/nav:link[@active]">
        <div class="selected"><xsl:value-of select="." /></div>
    </xsl:template>

    <xsl:template match="article:content">
        <div class="post-content">
            <xsl:copy-of select="*" />
        </div>
    </xsl:template>

    <xsl:template match="/">
        <html>
        <head>
            <title>
                <xsl:apply-templates select="//page:page[1]/@title" />
            </title>
            <link href="{$root-path}/css.php?file=style" rel="stylesheet" type="text/css" />
        </head>
        <body>
            <table id="main" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="3" id="header">
                    <xsl:apply-templates select="//nav:main[1]" />
                </td>
            </tr>
            <tr>
                <td id="leftbar">
                    <xsl:apply-templates select="//nav:submenu[1]" />
                </td>
                <td id="content">
                    <xsl:apply-templates select="//article:article[1]" />
                </td>
                <td id="rightbar">
                    <span>&#160;</span>
                </td>
            </tr>
            <tr>
                <td colspan="3" id="footer">
                    <span>&#160;</span>
                </td>
            </tr>
            </table>
        </body>
        </html>
    </xsl:template>

</xsl:stylesheet>